<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui">
<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<link rel="stylesheet" type="text/css"
		href="../../resources/estilo.css" />
	<title>Pagina do Professor!</title>
</h:head>


<h:body>


	<ui:include src="menu.xhtml" />
	<h5>
		Bem vindo professor(a):
		<h:outputText value="#{professorManager.init()}" />
	</h5>

	<div id="table">
		<h:form>

			<p:dataTable value="#{professorManager.turmas}" var="turma"
				paginator="true" rows="10">


				<p:column>
					<f:facet name="header">
						<h:outputText value="Curso" />
					</f:facet>

					<h:outputText id="curso" value="#{turma.curso.nome}" />
				</p:column>

				<p:column>
					<f:facet name="header">
						<h:outputText value="Dia" />
					</f:facet>
					<h:outputText value="#{turma.diaSemana}" />
				</p:column>

				<p:column style="width: 45px;">
					<f:facet name="header">
						<h:outputText value="Inicio" />
					</f:facet>
					<h:outputText value="#{turma.dataInicio}" />
				</p:column>

				<p:column style="width: 45px;">
					<f:facet name="header">
						<h:outputText value="Conclusão" />
					</f:facet>
					<h:outputText value="#{turma.dataConclusao}" />
				</p:column>

				<p:column style="width: 20px;">
					<f:facet name="header">
						<h:outputText value="Horario" />
					</f:facet>
					<h:outputText value="#{turma.horario}" />
				</p:column>

				<p:column style="width: 20px;">
					<f:facet name="header">
						<h:outputText value="Sala" />
					</f:facet>
					<h:outputText value="#{turma.sala}" />
				</p:column>

				<p:column >
					<f:facet name="header">
						<h:outputText value="Inscritos" />
					</f:facet>
					<h:commandButton id="teste" value="Mostrar" action="#{professorManager.direciona(turma.id)}" ajax="false"></h:commandButton>

				</p:column>
			</p:dataTable>
		</h:form>
	</div>
</h:body>
</html>